package com.czx.drivingtest.model.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * 用户存档信息
 * @author czx
 * @date 2020/7/15 13:05
 */
@Getter
@Setter
public class UserArchive {
    public UserArchive() {
        this.lastQuestionId = -1;
    }

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private long userId;
    /**
     * 用户最后一次做的题目id
     */
    private int lastQuestionId;
    /**
     * 用户错题数量
     */
    private int falseCount;
    /**
     * 用户回答正确题目数量
     */
//    private int trueCount;
    /**
     * 用户做过的题目数量
     */
    private int completeCount;
    /**
     * 习题总数
     */
    private int totalCount;

    private int subject;

    /**
     * 用户的总共答题数量 +1
     */
    public void increaseCompleteCount() {
        this.completeCount ++;
    }

    /**
     * 用户的错题数量+1
     */
    public void increaseFalseCount() {
        this.falseCount ++;
    }

    public void decreaseFalseCount() {
        this.falseCount --;
    }

}
